<!-- Sidebar Start -->
<aside class="sidebar">
    <!-- Tab Content Start -->
    <div class="tab-content">
        <!-- Chat Tab Content Start -->
        <div class="tab-pane active" id="chats-content">
            <div class="d-flex flex-column h-100">
                <div class="hide-scrollbar h-100" id="chatContactsList">
                    
                    <!-- Chat Header Start -->
                    <div class="sidebar-header sticky-top p-2">

                        <div class="d-flex justify-content-between align-items-center">
                            <!-- Chat Tab Pane Title Start -->
                            <h5 class="font-weight-semibold mb-0">聊天</h5>
                            <!-- Chat Tab Pane Title End -->

                            <ul class="nav flex-nowrap">

                                <!-- <li class="nav-item list-inline-item mr-1">
                                    <a class="nav-link text-muted px-1" href="#" title="Notifications" role="button" data-toggle="modal" data-target="#notificationModal">
                                        <svg class="hw-20" fill="none" viewBox="0 0 24 24" stroke="currentColor">
                                            <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 17h5l-1.405-1.405A2.032 2.032 0 0118 14.158V11a6.002 6.002 0 00-4-5.659V5a2 2 0 10-4 0v.341C7.67 6.165 6 8.388 6 11v3.159c0 .538-.214 1.055-.595 1.436L4 17h5m6 0v1a3 3 0 11-6 0v-1m6 0H9"/>
                                        </svg>
                                    </a>
                                </li> -->

                                <li class="nav-item list-inline-item mr-0">
                                    <div class="dropdown">
                                        <a class="nav-link text-muted px-1" href="#" role="button" title="Details" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                                            <!-- Default :: Inline SVG -->
                                            <svg class="hw-20" fill="none" viewBox="0 0 24 24" stroke="currentColor">
                                                <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 5v.01M12 12v.01M12 19v.01M12 6a1 1 0 110-2 1 1 0 010 2zm0 7a1 1 0 110-2 1 1 0 010 2zm0 7a1 1 0 110-2 1 1 0 010 2z"/>
                                            </svg>
                                                
                                            <!-- Alternate :: External File link -->
                                            <!-- <img src="__STATIC__/index/media/heroicons/outline/dots-vertical.svg" alt="" class="injectable hw-20"> -->
                                        </a>

                                        <div class="dropdown-menu dropdown-menu-right">
                                            <a class="dropdown-item" href="#" role="button" data-toggle="modal" data-target="#startConversation">新建对话</a>
                                            <!-- <a class="dropdown-item" href="#" role="button" data-toggle="modal" data-target="#createGroup">Create Group</a>
                                            <a class="dropdown-item" href="#" role="button" data-toggle="modal" data-target="#inviteOthers">Invite Others</a> -->
                                        </div>
                                    </div>
                                </li>
                            </ul>
                        </div>
                        
                        
                        <!-- Sidebar Header Start -->
                        <div class="sidebar-sub-header" style="display: none;">
                            <!-- Sidebar Header Dropdown Start -->
                            <div class="dropdown mr-2" >
                                <!-- Dropdown Button Start -->
                                <button class="btn btn-outline-default dropdown-toggle" type="button" data-chat-filter-list="" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                                    All Chats
                                </button>
                                <!-- Dropdown Button End -->

                                <!-- Dropdown Menu Start -->
                                <div class="dropdown-menu">
                                    <a class="dropdown-item" data-chat-filter="" data-select="all-chats" href="#">All Chats</a>
                                    <a class="dropdown-item" data-chat-filter="" data-select="friends" href="#">Friends</a>
                                    <a class="dropdown-item" data-chat-filter="" data-select="groups" href="#">Groups</a>
                                    <a class="dropdown-item" data-chat-filter="" data-select="unread" href="#">Unread</a>
                                    <a class="dropdown-item" data-chat-filter="" data-select="archived" href="#">Archived</a>
                                </div>
                                <!-- Dropdown Menu End -->
                            </div>
                            <!-- Sidebar Header Dropdown End -->

                            <!-- Sidebar Search Start -->
                            <form class="form-inline">
                                <div class="input-group">
                                    <input type="text" class="form-control search border-right-0 transparent-bg pr-0" placeholder="Search users...">
                                    <div class="input-group-append">
                                        <div class="input-group-text transparent-bg border-left-0" role="button">
                                            <!-- Default :: Inline SVG -->
                                            <svg class="text-muted hw-20" fill="none" viewBox="0 0 24 24" stroke="currentColor">
                                                <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"/>
                                            </svg>

                                            <!-- Alternate :: External File link -->
                                            <!-- <img class="injectable hw-20" src="__STATIC__/index/media/heroicons/outline/search.svg" alt=""> -->
                                        </div>
                                    </div>
                                </div>
                            </form>
                            <!-- Sidebar Search End -->
                        </div>
                        <!-- Sidebar Header End -->
                    </div>
                    <!-- Chat Header End -->

                    <!-- Chat Contact List Start -->
                    <ul class="contacts-list" id="chatContactTab" data-chat-list="">

                        <?php foreach ($sessions as $k => $vo): ?>
                        <!-- Chat Item Start -->
                        <li class="contacts-item friends" onclick="openChat(this)" data-sn="{:$vo['session_sn']}">
                            <a class="contacts-link" href="javascript:void(0);">
                                <div class="avatar avatar-online">
                                    <img src="__UPLOAD__/{:$vo['assistant']['image']}" alt="">
                                </div>
                                <div class="contacts-content">
                                    <div class="contacts-info">
                                        <h6 class="chat-name text-truncate">{:$vo['assistant']['name']}</h6>
                                        <div class="chat-time">{:$vo['msg']['ctime']}</div>
                                    </div>
                                    <div class="contacts-texts">
                                        <p class="text-truncate">{:$vo['msg']['message']}</p>
                                    </div>
                                </div>
                            </a>
                        </li>
                        <!-- Chat Item End -->
                        <?php endforeach ?>

                      
                    </ul>
                    <!-- Chat Contact List End -->
                    <div style="text-align: center;">
                        <button class="btn btn-outline-primary no-box-shadow" type="button" data-toggle="modal" data-target="#startConversation">
                            创建新的对话
                        </button>
                    </div>
                </div>
            </div>
        </div>
        <!-- Chats Tab Content End -->




        <!-- Profile Tab Content Start -->
        <div class="tab-pane" id="profile-content">
            <div class="d-flex flex-column h-100">
                <div class="hide-scrollbar">
                    <!-- Sidebar Header Start -->
                    <div class="sidebar-header sticky-top p-2 mb-3">
                        <h5 class="font-weight-semibold">Profile</h5>
                        <p class="text-muted mb-0">Personal Information & Settings</p>
                    </div>
                    <!-- Sidebar Header end -->

                    <!-- Sidebar Content Start -->
                    <div class="container-xl">
                        <div class="row">
                            <div class="col">

                                <!-- Card Start -->
                                <div class="card card-body card-bg-5">

                                    <!-- Card Details Start -->
                                    <div class="d-flex flex-column align-items-center">
                                        <div class="avatar avatar-lg mb-3">
                                            <img class="avatar-img" src="__UPLOAD__/{:$login_user['headimgurl']}" onerror="this.src='__STATIC__/index/media/avatar/3.png'" alt="">
                                        </div>
        
                                        <div class="d-flex flex-column align-items-center">
                                            <h5 id="info_nickname">{:$login_user['nickname']}</h5>
                                        </div>

                                        <div class="d-flex">
                                            <a class="btn btn-outline-default mx-1" type="button" href="{:url('user/logout')}">
                                                <!-- Default :: Inline SVG -->
                                                <svg class="hw-18 d-none d-sm-inline-block" fill="none" viewBox="0 0 24 24" stroke="currentColor">
                                                    <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M11 16l-4-4m0 0l4-4m-4 4h14m-5 4v1a3 3 0 01-3 3H6a3 3 0 01-3-3V7a3 3 0 013-3h7a3 3 0 013 3v1"/>
                                                </svg>
                                                    
                                                <!-- Alternate :: External File link -->
                                                <!-- <img class="injectable hw-18" src="__STATIC__/index/media/heroicons/outline/logout.svg" alt=""> -->
                                                <span>登出</span> 
                                            </a>
                                            <button class="btn btn-outline-default mx-1 d-xl-none" data-profile-edit="" type="button">
                                                <!-- Default :: Inline SVG -->
                                                <svg class="hw-18 d-none d-sm-inline-block" fill="none" viewBox="0 0 24 24" stroke="currentColor">
                                                    <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z"/>
                                                    <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 12a3 3 0 11-6 0 3 3 0 016 0z"/>
                                                </svg>
                                                    
                                                <!-- Alternate :: External File link -->
                                                <!-- <img class="injectable hw-18" src="__STATIC__/index/media/heroicons/outline/cog.svg" alt=""> -->
                                                <span>设置</span> 
                                            </button>
                                        </div>
                                    </div>
                                    <!-- Card Details End -->

                                    <!-- Card Options Start -->
                                    <div class="card-options">
                                        <div class="dropdown">
                                            <button class="btn btn-secondary btn-icon btn-minimal btn-sm text-muted text-muted" type="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                                                <!-- Default :: Inline SVG -->
                                                <svg class="hw-20" fill="none" viewBox="0 0 24 24" stroke="currentColor">
                                                    <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 5v.01M12 12v.01M12 19v.01M12 6a1 1 0 110-2 1 1 0 010 2zm0 7a1 1 0 110-2 1 1 0 010 2zm0 7a1 1 0 110-2 1 1 0 010 2z"/>
                                                </svg>
                                                    
                                                <!-- Alternate :: External File link -->
                                                <!-- <img class="injectable hw-20" src="__STATIC__/index/media/heroicons/outline/dots-vertical.svg" alt=""> -->
                                            </button>
                                            <div class="dropdown-menu">
                                                <a class="dropdown-item" href="#">Change Profile Picture</a>
                                                <a class="dropdown-item" href="#">Change Number</a>
                                            </div>
                                        </div>
                                    </div>
                                    <!-- Card Options End -->

                                </div>
                                <!-- Card End -->

                                <!-- Card Start -->
                                <div class="card mt-3">

                                    <!-- List Group Start -->
                                    <ul class="list-group list-group-flush">
                                        
                                        <!-- List Group Item Start -->
                                        <li class="list-group-item py-2">
                                            <div class="media align-items-center">
                                                <div class="media-body">
                                                    <p class="small text-muted mb-0">姓名</p>
                                                    <p class="mb-0" id="info_truename"></p>
                                                </div>
                                                <svg class="text-muted hw-20 ml-1" fill="none" viewBox="0 0 24 24" stroke="currentColor">
                                                    <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z"/>
                                                </svg>
                                            </div>
                                        </li>
                                        <!-- List Group Item End -->
                                        
                                        <!-- List Group Item Start -->
                                        <li class="list-group-item py-2">
                                            <div class="media align-items-center">
                                                <div class="media-body">
                                                    <p class="small text-muted mb-0">生日</p>
                                                    <p class="mb-0" id="info_birthday"></p>
                                                </div>
                                                <!-- Default :: Inline SVG -->
                                                <svg class="text-muted hw-20 ml-1" fill="none" viewBox="0 0 24 24" stroke="currentColor">
                                                    <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z"/>
                                                </svg>
                                                    
                                                <!-- Alternate :: External File link -->
                                                <!-- <img class="injectable text-muted hw-20 ml-1" src="__STATIC__/index/media/heroicons/outline/calendar.svg" alt=""> -->
                                            </div>
                                        </li>
                                        <!-- List Group Item End -->
                                        
                                        <!-- List Group Item Start -->
                                        <li class="list-group-item py-2">
                                            <div class="media align-items-center">
                                                <div class="media-body">
                                                    <p class="small text-muted mb-0">手机</p>
                                                    <p class="mb-0" id="info_mobile"></p>
                                                </div>
                                                <!-- Default :: Inline SVG -->
                                                <svg class="text-muted hw-20 ml-1" fill="none" viewBox="0 0 24 24" stroke="currentColor">
                                                    <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M3 5a2 2 0 012-2h3.28a1 1 0 01.948.684l1.498 4.493a1 1 0 01-.502 1.21l-2.257 1.13a11.042 11.042 0 005.516 5.516l1.13-2.257a1 1 0 011.21-.502l4.493 1.498a1 1 0 01.684.949V19a2 2 0 01-2 2h-1C9.716 21 3 14.284 3 6V5z"/>
                                                </svg>
                                                    
                                                <!-- Alternate :: External File link -->
                                                <!-- <img class="injectable text-muted hw-20 ml-1" src="__STATIC__/index/media/heroicons/outline/phone.svg" alt=""> -->
                                            </div>
                                        </li>
                                        <!-- List Group Item End -->

                                        <!-- List Group Item Start -->
                                        <li class="list-group-item py-2">
                                            <div class="media align-items-center">
                                                <div class="media-body">
                                                    <p class="small text-muted mb-0">Email</p>
                                                    <p class="mb-0" id="info_email"></p>
                                                </div>

                                                <!-- Default :: Inline SVG -->
                                                <svg class="text-muted hw-20 ml-1" fill="none" viewBox="0 0 24 24" stroke="currentColor">
                                                    <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M3 8l7.89 5.26a2 2 0 002.22 0L21 8M5 19h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z"/>
                                                </svg>
                                                    
                                                <!-- Alternate :: External File link -->
                                                <!-- <img class="injectable text-muted hw-20 ml-1" src="__STATIC__/index/media/heroicons/outline/mail.svg" alt=""> -->
                                            </div>
                                        </li>
                                        <!-- List Group Item End -->

                                        <!-- List Group Item Start -->
                                        <li class="list-group-item py-2">
                                            <div class="media align-items-center">
                                                <div class="media-body">
                                                    <p class="small text-muted mb-0">个性签名</p>
                                                    <p class="mb-0" id="info_signature"></p>
                                                </div>
                                                <!-- Default :: Inline SVG -->
                                                <svg class="text-muted hw-20 ml-1" fill="none" viewBox="0 0 24 24" stroke="currentColor">
                                                    <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M3.055 11H5a2 2 0 012 2v1a2 2 0 002 2 2 2 0 012 2v2.945M8 3.935V5.5A2.5 2.5 0 0010.5 8h.5a2 2 0 012 2 2 2 0 104 0 2 2 0 012-2h1.064M15 20.488V18a2 2 0 012-2h3.064M21 12a9 9 0 11-18 0 9 9 0 0118 0z"/>
                                                </svg>
                                                    
                                                <!-- Alternate :: External File link -->
                                                <!-- <img class="injectable text-muted hw-20 ml-1" src="__STATIC__/index/media/heroicons/outline/globe.svg" alt=""> -->
                                            </div>
                                        </li>
                                        <!-- List Group Item End -->
                                        
                                        <!-- List Group Item Start -->
                                        <li class="list-group-item pt-2">
                                            <div class="media align-items-center">
                                                <div class="media-body">
                                                    <p class="small text-muted mb-0">公司</p>
                                                    <p class="mb-0" id="info_company"></p>
                                                </div>
                                                <!-- Default :: Inline SVG -->
                                                <svg class="text-muted hw-20 ml-1" fill="none" viewBox="0 0 24 24" stroke="currentColor">
                                                    <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M3 12l2-2m0 0l7-7 7 7M5 10v10a1 1 0 001 1h3m10-11l2 2m-2-2v10a1 1 0 01-1 1h-3m-6 0a1 1 0 001-1v-4a1 1 0 011-1h2a1 1 0 011 1v4a1 1 0 001 1m-6 0h6"/>
                                                </svg>
                                                    
                                                <!-- Alternate :: External File link -->
                                                <!-- <img class="injectable text-muted hw-20 ml-1" src="__STATIC__/index/media/heroicons/outline/home.svg" alt=""> -->
                                            </div>
                                        </li>
                                        <!-- List Group Item End -->

                                    </ul>
                                    <!-- List Group End -->

                                </div>
                                <!-- Card End -->


                            </div>
                        </div>
                    </div>
                    <!-- Sidebar Content End -->
                </div>
            </div>
        </div>
        <!-- Profile Tab Content End -->
    </div>
    <!-- Tab Content End -->
</aside>
<!-- Sidebar End -->